package com.alipay.config;
import java.io.FileWriter;
import java.io.IOException;
/**
 * Created by 骑着蜗牛去旅行 on 2018/8/29.
 */
public class AlipayConfig {
    // ↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016091600528333";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCPIa/6kIBV7BIprYsfjPYZuMMpFbNZ3UO0bk5KG++5KM/ACNIiSMndYp3pXqqA6a6ZYYO1wLFADX3u7BhrdI2F0oG/ATHUGQERZbOIIhpEnKtBJ+W8cHr5GaZwIPlhGsY2BxikTGEohh4jnqkVhz6gKcVtuS7JqvfREXqG02uyNSBrrQX2jJFs5ISGQkMEYYx/WSUIi/uTOh0hysxlKPbWMsltvN0/hEQAPqthLUHf0fQC8lmoiRnVXCEN38V2LkhQLf0cHA9j73TyG8JOmh2/Cvvgyymk7nh8vIAFaUENKCyXvERnFUPzIZ53WgRcoMhGpj4Q/k0InAf9H3B/JAK9AgMBAAECggEAfn8HSCrtQQKiCrOVgQzTc2gXEvhaydEDRTM3fcey1bF76fvhuusZfM7rQJSpm8TqyiOkg70I6dMCuWVvL4iSivLAOE6V+x0eFIINaQK6tGjB8ZORNjkydXR15CNAQtGm25jp7kqSk330pQZT6PLeJi7EjXRcJV80JVGNOBsh0xxN6rkDbaw+XR2kYkCLOMtIAOhEt82a6/T/su/s5ahV/L0DvPu0oNegBVmi7AIn3G+tUPnAJTYWzd+Fm9A71vNXKcqGOSiMcTcVeN/ezqYto1TberGidctJ0mqaNv4oTvsWGjF8IPg9m/ziTFbHpGU7nAOvNDzWt9u7vk+H3WQfAQKBgQDKY5tXE6CSW1uyaYHZ9TisidVsKrzQPzsPehGjcOSzepzCLBSK0V2rrtDR3oIl8cDNElqy1Rv6BeVYDpqg2FJ/qvlnO9MEGs8q18wzf/YRDKJd8i80Ay4pJDNkoQ4zHVry2G6Iim20sFUWt/HvCzI9BTDj4gu0uHR5npbur4fOxwKBgQC1C7c+Icq0oa0FmHyaTv1PEwC6I5kOyVF1k23Ga0Mmn6yn9G+HM4q6auprKj+Hkb8Tay/C+fCtgyGN5bcJSaMBX8CtnwSQZ6krn5dNinJHxntKst11CIPG3qsjKfnkA3JCbBsAPFEl8VsbFW432ZQGTMbFJSKii+aM1vy9lNxuWwKBgE3LQb+TzMnVEgcfJQmJh9JSXNXqC4+kbmhBjJwdXdtbSvwcA31kgrPmS2AQPkilh22MG47X+Zv+Piy92FPxMqzeJGW5CiBuyaj3MAevrP7as2KXH+vHOSwZPSP2AEZHh1kHNl2HkCm/CcXkyLsQu6vW3fcKQWOi7yp8ehmfIP2rAoGAAyCMrboPskcIogwcOt4aaf8+B/kNb7/ydEFzp/W6VzRy2wPR2Vf+kXG/UtKL/l96GW/Eh22hxp15OuY43yQyeJea0GTqw0PHHEXJa0F07+BxyLyGLrtS62B1PEpBUrrsglEztjFUhX9Bv5oDKVvMvr8cv9MAYiZgeRZNj0i+9fkCgYAe2v6X0MtJf5j9K7GYBU7IbBXN3rHQEZHlByUIiKR0fJCLbZ9efKpdpS+TQ5rYBIJGYw7DhMN+14DvRQKNjKTekdIUil/gPMjU2RpVOYtr11+ijig095ucAbK8GgZBs4sf8R7bZ4xfYC7J8Bj5BZ0V6Hl2jQGKP4+Uv+RJB4ocNA==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm
    // 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqALB4EsNAZ8+MdaK1iMvS6vR5uNVG7YLNzdSWZ4XKRbWJ3XXMhW+N2kSLcZIMZmHEA7nnzVaA4pS7I9/1iGCN2MDXBFCIbxIdynWk5gfpuIDRg5FbBNarskRQSembfT4mUT6xEkcrFcTTELZdZqTH9ngUN5HtLELJzvltVYHMI+KggDI6EaMKB9xvXX1P+/vOTp6h0FbxQLOHhtP5FSwGJiadlWIv8UKtIq/MwEh4WOOYGhj/WyeoVLDCbKpeCyskCL4yyhb0Vte4dbejtJ0MKL1KLOysZRzxHxKjVQoHGydBr6LpAT1dXBEcSH/iWZd2mXkTxU5kQkBLQE1fisd6QIDAQAB";

    // 服务器异步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://malljelly.tunnel.qydev.com/soa/aliPayService/callBack/asynCallBack";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://malljelly.tunnel.qydev.com/soa/aliPayService/callBack/synCallBack";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";

    // ↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord
     *            要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
